<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>发送消息</title>
	<script type="text/javascript">
	<!--
	$(function(){
		$("#sysMsgFrom").validate({
			rules:{
				title:{
					required:true
					,maxlength:64
				},
				receivers:{
					required:true
				},
				content:{
					required:true
					,maxlength:1024
				}
			},
			errorClass: "help-inline",
			errorElement: "span",
			highlight:function(element, errorClass, validClass) {
				$(element).parents('.control-group').addClass('error');
			},
			unhighlight: function(element, errorClass, validClass) {
				$(element).parents('.control-group').removeClass('error');
				$(element).parents('.control-group').addClass('success');
			}
		});
		
		$("#sysMsgFrom").data("validator").settings.ignore += ":hidden:not(select[name='receivers'])";
	});
	//-->
	</script>
</head>
<body>
	<div class="container-fluid">
    <hr>
    <div class="row-fluid">
      <div class="span12"><a href="${pageContext.request.contextPath }/msg/querySent.do" class="btn btn-primary">返回</a></div>
    </div>
    <div class="row-fluid">
	    <div class="span12">
	        <div class="widget-box">
	          <div class="widget-title"> <span class="icon"> <i class="icon-info-sign"></i> </span>
	            <h5>发送消息</h5>
	          </div>
	          <div class="widget-content nopadding">
	            <form class="form-horizontal" method="post" enctype="multipart/form-data" action="${pageContext.request.contextPath }/msg/saveSysMsg.do" id="sysMsgFrom" novalidate="novalidate">
	              <div class="control-group">
	                <label class="control-label" for="title">标题</label>
	                <div class="controls">
	                  <input type="text" id="title" name="title" class="span6" placeholder="标题">
	                </div>
	              </div>
	              <div class="control-group">
	                <label class="control-label" for="receivers">接收人</label>
	                <div class="controls">
	                	<select class="span6" id="receivers" name="receivers" multiple="multiple" placeholder="接收人">
	                	<c:forEach var="sysUser" items="${sysUsers }">
	                	<option value="${sysUser.userId }">${sysUser.userName }</option>
	                	</c:forEach>
	                	</select>
	                </div>
	              </div>
	              <div class="control-group">
	                <label class="control-label" for="f_content">内容</label>
	                <div class="controls">
	                	<textarea rows="5" class="span6" id="f_content" name="content" placeholder="消息内容"></textarea>
	                </div>
	              </div>
	              <div class="control-group">
	                <label class="control-label" for="files">附件</label>
	                <div class="controls">
	                  <input type="file" class="span6" id="files" name="files" multiple="multiple" />
	                </div>
	              </div>
	              <div class="form-actions">
	                <input type="submit" value="提交" class="btn btn-success">
	              </div>
	            </form>
	          </div>
	        </div>
	      </div>
      </div>
    </div>
</body>
</html>